#ifndef __JSON_UTILS_H
#define __JSON_UTILS_H

#include <stdio.h>
#include <string.h>

#define STRING char *
#define uint unsigned int

#define VALUE_TYPE_NORMALPAIR 0
#define VALUE_TYPE_JSONOBJ 1   
#define VALUE_TYPE_JSONARRAY 2

#define MEM_SIZE_STRUCTURE 1024
#define MEM_SIZE_JSONDATA 1024
#define MEM_SIZE_JSONPARSEDATA 1024

typedef struct _JsonPair{

		char *key;
		char *value;
		int keyLength;
		int valueLength;
	
		struct _JsonObject **obj;
		int jsonObjLength;
	
		int valueType;
	
		struct _JsonPair *next;
		//struct _JsonPair *prev;
	
		//char* (* setPair)(struct _JsonPair *this, char *key, char *value);
		//char* (* getValue)(struct _JsonPair *this, char *key);
} JsonPair;

typedef struct _JsonObject{
		struct _JsonPair *jsonPair;
		struct _JsonPair *lastJsonPair;
		struct _JsonObject *next;
	  	int length;
} JsonObject;

char* testNewJsonGenerateUtil();
char *structureMemFree();
char *dataMemFree();
void testNewJsonParseUtil();
#endif
